package com.zhou.framework.util;

import com.zhou.util.StringTool;
import com.zhou.framework.model.PageParam;

/**
 * @author lang.zhou
 * @since 2023/2/28
 */
public class OrderUtil {

    public static String getOrder(PageParam param){
        StringBuilder s = new StringBuilder();
        if(StringTool.isNotBlank(param.getOrderColumn())){
            s.append(param.getOrderColumn());
            if(StringTool.isNotBlank(param.getOrderType()) && param.getOrderType().startsWith("desc")){
                s.append(" desc");
            }else{
                s.append(" asc");
            }
        }
        return s.toString();
    }
}
